﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <title>深拷贝</title>
    <script src="../jquery-1.7.2.min.js"></script>
    <script>
        $(function() {
            var a = { str: 'String', arr: [{ first: 1 }, { first: 2 }] };
            var b = {};
            //var b = { key1: obj, key2: obj };
            var c = $.extend(true, b, a); // c.key1 === c.key2 -> false
            a.arr[0].first = 5;
            c.arr[0].first = 6;
            var s = 5;
        });
    </script>
</head>
<body>

</body>
</html>
